<template>
    <el-tabs v-model="activeName">
    <!--添加标签tabs-->
    <el-tab-pane label="添加标签" name="first">
        <el-form ref="form" :model="sizeForm" label-width="80px" size="medium" >
            <el-form-item label="标签名">
                <el-input v-model="sizeForm.menuName"></el-input>
            </el-form-item>
            <!--链接名-->
            <el-form-item label="跳转链接">
                <el-input type="textarea" v-model="sizeForm.menuUrl" class="textarea" rows="5"></el-input>
            </el-form-item>
            <el-form-item label="排序">
                <el-input type="text" v-model="sizeForm.menuSort"  rows="6"></el-input>
            </el-form-item>
            <el-form-item label="标签样式">
                <el-input type="text" v-model="sizeForm.menuBarIcon"></el-input>
            </el-form-item>
            <el-form-item label="是否显示" class="isDisplay">
                <el-radio-group v-model="sizeForm.menuStatus" size="medium">
                    <el-radio v-model="sizeForm.menuStatus" border :label="0">是</el-radio>
                    <el-radio  v-model="sizeForm.menuStatus" border :label="1">否</el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item size="large" class="create-button">
                <el-button type="primary" @click="onSubmit('form')">立即修改</el-button>
                <el-button>取消</el-button>
            </el-form-item>
        </el-form>
    </el-tab-pane>
    </el-tabs>
</template>

<script>
    export default {
        name: "updateMenu_management",
        data(){
            return{
                activeName:'first',
                sizeForm:{

                }
            }
        },
        methods:{
            onSubmit(form){
                this.$axios.post('/api/menu/updateMenuBar',{menuId:this.sizeForm.menuId,menuName:this.sizeForm.menuName.trim(),menuUrl:this.sizeForm.menuUrl.trim(),menuSort:this.sizeForm.menuSort, menuStatus:this.sizeForm.menuStatus,menuBarIcon:this.sizeForm.menuBarIcon}).then((res)=>{

                    console.log('121')
                    this.$router.push({name:'Menu_management'})
                })
            }
        },
        created() {
            console.log('1')
            console.log(JSON.parse(sessionStorage.getItem("sizeForm")))
            this.sizeForm=JSON.parse(sessionStorage.getItem("sizeForm"))

        }
    }
</script>

<style scoped>
    .el-form{
        width: 40%;
        overflow: hidden;
        padding-top: 20px;
    }
</style>